import unittest


class MyTestCase(unittest.TestCase):
    def test_read_file_to_string(self):
        with open('hello.txt', 'r') as f:
            # 断言f.read()包含hello
            self.assertTrue("hello" in f.read())

    def test_read_file_to_list(self):
        with open('hello.txt', 'r') as f:
            # 断言等于['hello', 'world']
            self.assertEqual(['hello\n', 'world'], f.readlines())
